#include<bits/stdc++.h>
using namespace std;
#define int long long
signed main()
{
	int n,  t;
	cin >> n >> t;
	int cnt = 0, cur = 1, x = 0, haend = 0;
	for (int i = 0; i < n; i++) {// 1 2 10 
		cin >> x;// 1 
		if (x < haend) {
			cnt += x - cur;
		}else{
			cnt += t;
		}
		cur = x;
		haend = x + t;
	}
//	cnt += haend - cur;
	cout << cnt << endl;
	return 0;
}
